import React from 'react';
import ReactDOM from 'react-dom';
import { Router, Route, IndexRoute, hashHistory, browserHistory } from 'react-router';

import './index.css';
import App from './App';
import registerServiceWorker from './registerServiceWorker';

import Demo4Component from './component/demo4Compent/demo4Component';

import RouterTest from './component/demo7Compent/routerTest';

import NavLink from './component/navLink/navLink';

// import CommentApp from './component/CommentApp';

// import Top from './component/test1/top';

// ReactDOM.render(<App />, document.getElementById('root'));

// ReactDOM.render(<CommentApp />, document.getElementById('root'));

const router = (
  <Router history={hashHistory}>
    <Route path="/" component={App}>
      <IndexRoute component={RouterTest} />
      <Route path="/c4" component={Demo4Component} />
      <Route path="/c5" component={NavLink}>
        <Route path="/test1" component={RouterTest} />
        <Route path="/test2" component={Demo4Component} />
      </Route>
    </Route>
  </Router>
);

ReactDOM.render(router, document.getElementById('root'));
registerServiceWorker();
